package com.w2cx.selenium.business;

import com.w2cx.selenium.base.DriverBase;
import com.w2cx.selenium.operate.CommentManageOperate;

public class CommentManageProcess {

    DriverBase driver;
    CommentManageOperate cmh;
    String beforeStatusName = null;
    String afterStatusName = null;
    public CommentManageProcess(DriverBase driver){
        this.driver = driver;
        cmh = new CommentManageOperate(driver);
    }

    //操作状态开关
    public void operateStatus(){

        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        //点击内容审核
        cmh.clickContentReviewMenu();
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }


        //点击评论管理
        cmh.clickCommentManage();
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        //获取状态名称
        beforeStatusName = cmh.getStatusName();
        System.out.println("操作之前状态名称为："+beforeStatusName);
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }


        //点击状态开关
        cmh.clickCommentStatus();
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }


        //获取状态名称
        afterStatusName = cmh.getStatusName();
        System.out.println("操作之后状态名称为："+afterStatusName);
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }




    }


    //断言
    public boolean operateStatusSuccess(){
        if(!beforeStatusName.equals(afterStatusName)){
            return true;
        }else {
            return false;
        }
    }


}
